﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Windows.Controls.Ribbon;

namespace ChoDiaOc_HK_WPF.Views {
    /// <summary>
    /// Interaction logic for ManHinhChupAnh.xaml
    /// </summary>
    public partial class ManHinhChupAnh : RibbonWindow {

        private ChupAnh.ThongTinChupAnh thongTinChupAnhControl = null;

        public ChupAnh.ThongTinChupAnh ThongTinChupAnhControl {
            get {
                if (thongTinChupAnhControl == null) {
                    thongTinChupAnhControl = new ChupAnh.ThongTinChupAnh();
                } return thongTinChupAnhControl;
            }
        }
        private ChupAnh.DangAnh dangAnhControl = null;

        public ChupAnh.DangAnh DangAnhControl {
            get {
                if (dangAnhControl == null) {
                    dangAnhControl = new ChupAnh.DangAnh();
                } return dangAnhControl;
            }
        }
        public ManHinhChupAnh() {
            InitializeComponent();

            // Insert code required on object creation below this point.

            App.ManHinhChupAnh = this;
        }

        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
            e.Cancel = true;
            this.Hide();
            gridMain.Children.Clear();
            thongTinChupAnhControl = null;
            dangAnhControl = null;   
            gridMain.Children.Add(ThongTinChupAnhControl);
        }

        private void Window_Loaded(object sender, RoutedEventArgs e) {
            gridMain.Children.Clear();           
            gridMain.Children.Add(ThongTinChupAnhControl);
        }

        private void btnThongTinChupAnh_Click(object sender, RoutedEventArgs e) {
            gridMain.Children.Clear();
            gridMain.Children.Add(ThongTinChupAnhControl);
        }

        private void btnDangAnh_Click(object sender, RoutedEventArgs e) {
            gridMain.Children.Clear();
            gridMain.Children.Add(DangAnhControl);
        }

        private void btnBack_Click(object sender, RoutedEventArgs e) {
            if (MessageBoxResult.OK == MessageBox.Show("Có chắc chắn không?", "Cảnh báo", MessageBoxButton.OKCancel, MessageBoxImage.Warning, MessageBoxResult.Cancel, MessageBoxOptions.None)) {
                this.Close();
            }
        }
    }
}
